package com.ynwa.thread;

/**
 * @author gzd
 * @date 2018/4/23 15:03
 * @desc Volatile测试的main方法
 */
public class VolatileTestMain {

    public static void main(String[] args) {
        VolatileTestUser user = new VolatileTestUser();
        System.out.println("user的age初始值是：" + user.age);

        Runnable runnable1 = () -> {
            user.age = 1000;
            System.out.println("");
        };

        Runnable runnable2 = () -> {
            System.out.println("");
        };
        Thread thread1 = new Thread(runnable1, "thread-1");
        Thread thread2 = new Thread(runnable2, "thread-2");

    }
}
